﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IFSModel;


namespace IFSController
{
    public class Helper
    {
        public static bool AddLog(log newLog)
        {
            using (var dataContext = new IFNDBDataContext())
            {
                newLog.datetime = DateTime.Now;
                try
                {
                    dataContext.logs.InsertOnSubmit(newLog);
                    dataContext.SubmitChanges();
                }
                catch (Exception)
                {
                    return false;
                }

                return true;
            }
        }
        public class Result
        {
            public bool Success;
            public string Msg;
            public Result(bool success, string msg)
            {
                this.Success = success;
                this.Msg = msg;
            }
            public Result(bool success)
            {
                this.Success = success;
            }
            public Result(string msg)
            {
                this.Msg = msg;
            }
            public Result()
            {
                
            }
        }
    }
}
